<%--

    Область для отрисовки сообщений валидации

--%>

<%@page contentType="text/html" pageEncoding="UTF-8" %>

<%@taglib prefix="f" uri="http://java.sun.com/jsf/core" %>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html" %>
<%@taglib prefix="a4j" uri="http://richfaces.org/a4j" %>
<%@taglib prefix="rich" uri="http://richfaces.org/rich" %>

<f:subview id="modalmessages">

    <f:verbatim>
        <script type="text/javascript" src="resources/js/prototype.js"></script>

        <script type="text/javascript">
            function proceedModalMessagesAndGo(msgs, link)
            {
                proceedModalMessages(msgs);
                if (msgs) showModalMessage(msgs);
                else go(link);
            }

            function proceedModalMessages(msgs)
            {
                if (msgs) showModalMessage(msgs);
            }

            function showModalMessage(msg)
            {
                $('modalmessages:tbModalMessage').innerHTML = msg;
                showModalMessagePanel();
            }

            function showModalMessagePanel()
            {
                Richfaces.showModalPanel('modalmessages:modalMessages');
                setTimeout(function()
                {
                    Richfaces.hideModalPanel('modalmessages:modalMessages');
                }, 2000);
            }
        </script>
    </f:verbatim>

    <rich:modalPanel id="modalMessages" autosized="true" width="300">
        <h:outputText id="tbModalMessage"/>
    </rich:modalPanel>
</f:subview>
